/*
* ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
* Without permission, no one has the right to obtain, disclose or use this software in any way.
*/

package com.ecarx.notificationx;

import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.core.graphics.drawable.IconCompat;

import java.util.List;

public class BundleBuilder {

    private Bundle bundle = new Bundle();

    public Bundle build() {
        return bundle;
    }

    public BundleBuilder setSuggestActions(@NonNull List<ActionCompat2> actions) {
        bundle.putParcelableArrayList(NotificationHelper.EXTRA_SUGGEST_ACTION_LIST, NotificationHelper.actionsToBundles(actions));
        return this;
    }

    public BundleBuilder setNotificationType(@NonNull @NotificationHelper.NOTIFICATION_TYPE_A String type) {
        bundle.putString(NotificationHelper.EXTRA_NOTIFICATION_TYPE, type);
        return this;
    }

    public BundleBuilder setImage(@NonNull IconCompat image) {
        bundle.putParcelable(NotificationHelper.EXTRA_IMAGE, image.toBundle());
        return this;
    }

    public BundleBuilder setShowSuggestActions(boolean showSuggestActions) {
        bundle.putBoolean(NotificationHelper.EXTRA_SHOW_SUGGEST_ACTIONS, showSuggestActions);
        return this;
    }

    public BundleBuilder setNeedTTS(boolean needTTs) {
        bundle.putBoolean(NotificationHelper.EXTRA_NEED_TTS, needTTs);
        return this;
    }

    public BundleBuilder setNeedBubble(boolean needBubble) {
        bundle.putBoolean(NotificationHelper.EXTRA_NEED_SHOW_BUBBLE, needBubble);
        return this;
    }

    public BundleBuilder setBubbleText(@NonNull String bubbleText) {
        bundle.putString(NotificationHelper.EXTRA_BUBBLE_TEXT, bubbleText);
        return this;
    }

    public BundleBuilder setSmallTip(@NonNull ActionCompat2 tips) {
        bundle.putBundle(NotificationHelper.EXTRA_SMALL_TIP, tips.toBundle());
        return this;
    }

    public BundleBuilder setLargeTip(@NonNull ActionCompat2 tips) {
        bundle.putBundle(NotificationHelper.EXTRA_LARGE_TIP, tips.toBundle());
        return this;
    }

}
